TOC-As-3
1. Construct NPDA’s that recognize the following languages over . (10 pt for each)
a.

b.

c.

2. Show that the language is not contexr-free.
Let
Assume L is context-free.
Let
And
Suppose
By the pumping lemma,
Because
Thus
Therefore
Which means
Therefore
Therefore L is not context-free.
3. Convert the following grammar to an NPDA. (8pt)

4. Let . Design a (nondeterministic) TM for each following language. (10 pt each)
a.

b.

c.

d.

5. Design a TM for each integer subtraction: for . You need to clearly how the input and the side effect are encoded. (8pt each)
Let
- Use
0to represent positive numbers in the unary system. - Use
#as a separator between the two numbers. - Use
-as a special marker to indicate a negative result when. - Use
xas a symbol to do the subtraction.
Input Format
- The first part of the tape will consist of a sequence of
0s representing. - The second part, after the separator
#, will contain a sequence of10s representing.
For example:
000#00represents, should be output as 0(positive result).00#000represents, and should be output as -0(negative result).

6. Let Design a which decides whether the symbol is on the tape. (8pt)


